﻿// <copyright file="InfoForm.cs" company="Horiba Medical">
//     Copyright (c) Horiba Medical. All rights reserved.
// </copyright>
// <summary>
//     Provides a form similar to the message box standard form.
// </summary>

namespace DoxyOutParser.Forms
{
	using System;
	using System.Windows.Forms;

	/// <summary>
	/// Access functions to the InfoForm class.
	/// </summary>
	public partial class InfoForm : Form
	{
		/// <summary>
		/// Initializes a new instance of the InfoForm class.
		/// </summary>
		public InfoForm()
		{
			this.InitializeComponent();
			this.CenterToScreen();
		}

		/// <summary>
		/// Initializes a new instance of the InfoForm class.
		/// </summary>
		/// <param name="infoText">The text displayed on the textbox.</param>
		/// <param name="captionText">The text displayed on the title bar.</param>
		public InfoForm(string infoText, string captionText)
		{
			this.InitializeComponent();
			this.SetText(infoText);
			this.Text = captionText;
			this.CenterToScreen();
		}

		/// <summary>
		/// Sets the textbox on the info form.
		/// </summary>
		/// <param name="newText">New text to display.</param>
		public void SetText(string newText)
		{
			this.infoBox.Text = newText;
		}

		/// <summary>
		/// Action taken when clicking on the OK button.
		/// </summary>
		/// <param name="sender">Event sender.</param>
		/// <param name="e">Event parameters.</param>
		private void OKButton_Click(object sender, EventArgs e)
		{
			this.Close();
			this.Dispose();
		}
	}
}
